<include file="layout/header" />
<script src="__JS__/dialog/layer.js"></script>
<link rel="stylesheet" type="text/css" href="__CSS__/manage/user/add.css">
<div id="content">

<section id="widget-grid" class="">
	<div class="row">
		<article class="col-sm-12 col-md-12 col-lg-8">
			<div class="jarviswidget  jarviswidget-sortable jarviswidget-color-white" id="wid-id-1" data-widget-editbutton="false" data-widget-custombutton="false" data-widget-attstyle="jarviswidget-color-white" role="widget" style="position: relative; opacity: 1; left: 0px; top: 0px;">

				<header role="heading">
					<div class="jarviswidget-ctrls" role="menu"></div>
					<span class="widget-icon"> <i class="fa fa-edit"></i> </span>
					<h2>添加用户</h2>
				</header>

				<!-- widget div-->
				<div role="content">
					
					<!-- widget edit box -->
					<div class="jarviswidget-editbox">
						<!-- This area used as dropdown edit box -->
						
					</div>
					<!-- end widget edit box -->
					
					<!-- widget content -->
					<div class="widget-body">
						
						<form id="checkout-form" class="smart-form form-horizontal" novalidate="novalidate">
							<fieldset>
								<div class="row form-group list">
									<label class=" col col-2 control-label">身份</label>
									<section class="col col-9">
										<input type="text" name="type" v-model="idStr" style="display: none;">
										<div class="idenBox">
											<p class="iden" @click="idenShow=!idenShow">
												<span v-if="idenNameArr.length == 0">请选择身份</span>
												<b v-if="idenNameArr.length != 0" v-for="(v,index) in idenNameArr" :key="index">{{v}}</b>
											</p>
											<div class="idenBigBox" v-if="idenShow">
												<div class="box">
													<div class="leftNav">
														<ul class="idenList">
															<li v-for="(v,index) in iden">
																<span @click="lNum=index" :class="index==lNum?'active':''">{{v.type}}</span>
																<div class="rightBox" v-if="index==lNum">
																	<div class="topList">
																		<ul>
																			<li v-for="(v1,index1) in v.depa">
																				<span @click="tNum=index1" :class="index1==tNum?'active':''">{{v1.type}}</span>
																				<div class="contList" v-if="index1==tNum">
																					<ul class="nowIden">
																						<li v-for="(v2,index2) in v1.people" :did="v2.id" @click="addIden($event,v2.id,v2.name)">{{v2.name}}</li>
																					</ul>
																				</div>
																			</li>
																		</ul>
																	</div>
																</div>
															</li>
														</ul>
													</div>
												</div>
											</div>
										</div>
									</section>
								</div>
								<div class="row form-group list" v-for="(v,index) in all" v-if="!noName && v.isShow">
									<label class="user_label col col-2 control-label">{{v.lName}}</label>

									<!-- 性别 -->
									<section class="col col-9" v-if="v.name=='sex'">
										<div class="inline-group">
											<label class="radio">
					            				<input type="radio" value="1" :name="v.name" checked="checked">
												<i></i><span style="display: block;height: 100%;line-height: 100%;">男</span>
											</label>
											<label class="radio">
												<input type="radio" value="2" :name="v.name">
												<i></i><span style="display: block;height: 100%;line-height: 100%;">女</span>
											</label>
										</div>
									</section>

									<!-- 所在地 -->
									<div v-else-if="v.name=='place'">
										<section class="col col-3">
											<label class="select">
							                	<select class="input-xs p_list" :name="v.type[0]" @change="changePlace($event,'pid')">
								                    <option value="0">省</option>
								                    <option v-for="(v,index) in pArr" :value="v.id">{{v.name}}</option>
							                	</select>
							                	<i></i>
							                </label>
										</section>
										<section class="col col-3">
											<label class="select">
							                	<select class="input-xs c_list" :name="v.type[1]" @change="changePlace($event,'cid')">
													<option value="0">市</option>
								                    <option v-for="(v,index) in cArr" :value="v.id">{{v.name}}</option>				
								                </select>
							                	<i></i>
							                </label>
										</section>
										<section class="col col-3">
											<label class="select">
							                	<select class="input-xs a_list" :name="v.type[2]">
								                    <option value="0">区</option>
								                    <option v-for="(v,index) in aArr" :value="v.id">{{v.name}}</option>
							                	</select>
							                	<i></i>
							                </label>
										</section>
									</div>
									

									<!-- input file -->
									<section class="col col-9" v-else-if="v.name=='id_just'||v.name=='id_back'||v.name=='photo'">
										<div class="col-md-10">
	                                    	<input type="file" name="photo" class="btn btn-default">
	                            		</div>
	                                    <div class="col-md-offset-2 img_box"></div>
                                    </section>

                                    <!-- 无条件 -->
                                    <section class="col col-9" v-else>
										<label class="input">
				               				<input type="text" class="input_absolute"  :name="v.name" value=""> 
				               			</label>
									</section>

								</div>
								
								<div class="row form-group list" v-for="(v,index) in optional" :key="index" v-if="!noName && v.isShow">
									<label class="user_label col col-2 control-label">{{v.lName}}</label>

									<!-- 工牌 -->
									<section class="col col-9" v-if="v.name == 'wcard' || v.name == 'tel'">
										<label class="input">
				               				<input type="text" class="input_absolute"  :name="v.name" value=""> 
				               			</label>
									</section>

									<!-- 更多身份 -->
									<section class="col col-9" v-else>
			               				<div class="col-md-10">
	                                    	<input type="file" name="photo" class="btn btn-default">
	                            		</div>
	                                    <div class="col-md-offset-2 img_box"></div> 
									</section>
								</div>

								<div class="row form-group list" v-for="(v,index) in onlyNoName" :key="index" v-if="noName && v.isShow">
									<label class="user_label col col-2 control-label">{{v.lName}}</label>

									<section class="col col-9" v-if="v.name == 'photo'">
			               				<div class="col-md-10">
	                                    	<input type="file" name="photo" class="btn btn-default">
	                            		</div>
	                                    <div class="col-md-offset-2 img_box"></div> 
									</section>

									<section class="col col-9" v-else>
										<label class="input">
				               				<input type="text" class="input_absolute"  :name="v.name" value=""> 
				               			</label>
									</section>
									
								</div>
							</fieldset>
							<footer>
								<button type="button" style="float: right;margin-right: 10px;margin-bottom: 10px;" id="user_add" class="btn btn-primary" @click="addUser">提交</button>
								<button type="button" style="float: right;margin-right: 10px;margin-bottom: 10px;" class="btn btn-primary btn-info " onclick="window.history.back();">返回</button>
							</footer>
						</form>
					</div>
					<!-- end widget content -->
				</div>
				<!-- end widget div -->
			</div>
		</article>
	</div>
</section>
<script type="text/javascript" src="__JS__/manage/user/add2.js"></script>
<include file="layout/footer" />
